/*
# File    :   fsm_demo.c
# Author  :   SCHIPS
# Mail    :   schips@dingtalk.com
# Git     :   https://gitee.com/schips/
# Date    :   Mon, May 50, 2019  13:14:52 PM  ♡
*/


#include <stdio.h>
#include "fsm.h"
int main(void)
{
    int ret = 0;

    SM_ARG var;
    InitStateMachine(&var);
    while(1)
    {
        printf("cs = %d, ns = %d\n",var.st.cs,var.st.ns);

        BestStateMachine(&var);

        // 停止条件
        if(var.st.cs == s_done)
        {
            ResetStateMachine(&var);
            //break;
        }
        ret++;
        if(ret >10)
        {
            break;
        }
    }
    return 0;
}
